package cc.spider.demo;

import cc.spider.web.queue.RedisUniqueQueue;
import cc.spider.web.config.Task;
import java.util.UUID;

public class Test {
    public static void main(String[] args) {
        UUID uuid = UUID.randomUUID();
        RedisUniqueQueue redisPriorityQueue = new RedisUniqueQueue(uuid.toString());
        for (int i = 0; i < 10; i++) {
            Task task = new Task();
            task.setTaskName("name_" + i);
            redisPriorityQueue.enqueue(task);
        }
        System.out.println("-----------");
        for (int i = 0; i < 10; i++) {
            Task task = (Task) redisPriorityQueue.dequeue();
            System.out.println(task.getTaskName());
        }
    }


}
